
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <title>Off Canvas Template for Bootstrap</title>
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link href="http://v3.bootcss.com/assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet">
    <link href="/static/pc/cmgd.css" rel="stylesheet">
    <link rel="stylesheet" href="/static/pc/swiper.3.2.0.min.css">

    <link rel="stylesheet" type="text/css" href="/static/admin/webupload/webuploader.css">
    <link rel="stylesheet" type="text/css" href="/static/admin/webupload/style.css">

    <!--[if lt IE 9]><script src="http://v3.bootcss.com/assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <script src="http://v3.bootcss.com/assets/js/ie-emulation-modes-warning.js"></script>
    <!--[if lt IE 9]>
    <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script src="/static/admin/js/jquery.min.js?v=2.1.4"></script>
    <script src="/static/admin/js/layer/layer.js"></script>
    <script src="/static/admin/js/laypage/laypage.js"></script>
    <script src="/static/admin/js/laytpl/laytpl.js"></script>
    <link href="/static/admin/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <style>
        .list-group-item:first-child        {border-radius: 0px;}
        .fa{padding-right: 5px;font-size:22px;}
        .list-group-item{font-size:16px;}
        .panel-primary>.panel-heading {
            color: #fff;
            background-color: #2fab87;
            border-color: #2fab87;
        }

        .panel-primary {
            border-color: #2fab87;
        }

    </style>
</head>

<body>
{include file="public/header2" /}
<div class="container body_bg" style="margin-top:80px;">

    <div class="row row-offcanvas row-offcanvas-right">
        <div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar">
            <div style="width: 100%;height:80px;border:1px solid #ddd;border-bottom:0px solid #ddd;padding-top: 10px;padding-left: 10px;" >
                <div style="width:60px;float: left;margin-right:10px;">
                    <img src="/uploads/face/{$member.head_img}" style="width: 60px;height: 60px;">
                </div>
                <div style="float: left;width: 178px;">
                    <div style="width: 178px;overflow: hidden;padding-top: 3px;">{$member.nickname}</div>
                    <div style="width: 178px;overflow: hidden;padding-top: 12px;">ID:{$member.account}</div>
                </div>
            </div>
            <div class="list-group">
                <a href="{:url('write')}" class="list-group-item "><i class="fa fa-pencil-square-o "></i>写文章</a>
                <a href="{:url('write_debate')}" class="list-group-item"><i class="fa fa fa-comment-o "></i>论话题</a>
                <a href="{:url('myessay')}" class="list-group-item"><i class="fa fa-file-text-o "></i>已投征文</a>
                <a href="{:url('draft')}" class="list-group-item"><i class="fa fa-folder-open-o "></i>我的草稿箱</a>
                <a href="{:url('collect')}" class="list-group-item"><i class="fa fa-heart-o "></i>我的收藏</a>
                <a href="{:url('temp_message')}" class="list-group-item"><i class="fa fa-bell-o "></i>模板消息</a>
            </div>
        </div><!--/.sidebar-offcanvas-->
        <div class="col-xs-12 col-sm-9">

            <div class="panel panel-primary">
                <div class="panel-heading" >
                  我的征文
                </div>
                <div class="panel-body">
                    <div class="example-wrap">
                        <div class="example">
                            <table class="table table-bordered table-hover">
                                <thead>
                                <tr class="long-tr">
                                    <th width="3%">ID</th>
                                    <th width="15%">征文标题</th>
                                    <th width="15%">投稿文章</th>
                                    <th width="10%">提交时间</th>
                                    <th width="12%">操作</th>
                                </tr>
                                </thead>
                                <script id="arlist" type="text/html">
                                    {{# for(var i=0;i<d.length;i++){  }}
                                <tr class="long-td">

                                    <td>{{d[i].id}}</td>
                                    <td>{{d[i].essay_title}}</td>
                                    <td>{{d[i].article_title}}</td>
                                    <td>{{d[i].add_time}}</td>
                                    <td>
                                        <a href="javascript:;" onclick="urlto({{d[i].article_id}})"  class="btn btn-primary btn-xs btn-outline">
                                            <i class="fa fa-paste"></i>查看文章</a>
                                    </td>
                                </tr>

                                    {{# } }}
                                </script>
                                <tbody id="article_list"></tbody>

                            </table>

                            <div id="AjaxPage" style=" text-align: right;"></div>
                            <div id="allpage" style=" text-align: right;"></div>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div><!--/row-->

    <hr>

    <footer  style="text-align: center;">
        <p>&copy; Company 2017</p>
    </footer>

</div><!--/.container-->


<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="../../assets/js/vendor/jquery.min.js"><\/script>')</script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="http://v3.bootcss.com/assets/js/ie10-viewport-bug-workaround.js"></script>
<script src="http://v3.bootcss.com/examples/offcanvas/offcanvas.js"></script>
<script type="text/javascript">
function Ajaxpage(curr){

                $.getJSON('{:url("Article/myessay")}', {
                page: curr || 1
                }, function(data){      //data是后台返回过来的JSON数据

                $(".spiner-example").css('display','none'); //数据加载完关闭动画
                if(data==''){
                $("#article_list").html('<td colspan="20" style="padding-top:10px;padding-bottom:10px;font-size:16px;text-align:center">暂无数据</td>');
                }else{


                    console.log(data);

                article_list(data.list); //模板赋值
                laypage({
                cont: $('#AjaxPage'),//容器。值支持id名、原生dom对象，jquery对象,
                pages:'{$allpage}',//总页数
                skip: true,//是否开启跳页
                skin: '#1AB5B7',//分页组件颜色
                curr: curr || 1,
                groups: 3,//连续显示分页数
                jump: function(obj, first){

                if(!first){
                Ajaxpage(obj.curr)
                }
                $('#allpage').html('第'+ obj.curr +'页，共'+ obj.pages +'页');
                }
                });
                }
                });
                }

                Ajaxpage();
            function article_list(list){

                var tpl = document.getElementById('arlist').innerHTML;
                laytpl(tpl).render(list, function(html){
                    document.getElementById('article_list').innerHTML = html;
                });
            }

            function urlto(id){
                location.href = './index/id/'+id+'.html';
            }


</script>
</body>
</html>
